<?php
header("Content-Type: application/x-javascript; charset=utf-8");
function safe_file_get_contents($filename)
{
    $fp = fopen($filename, 'rb');
    if ($fp) {
        flock($fp, LOCK_SH);
        clearstatcache();
        $filesize = filesize($filename);
        if ($filesize > 0) {
            $data = fread($fp, $filesize);
        } else {
        	$data = false;
        }
        flock($fp, LOCK_UN);
        fclose($fp);
        return $data;
    } else {
        return '/*file can\'t be access.*/';
    }
}
$path = $_GET['path'];
$pos = strrpos($path, "/");
$pkg = str_replace("/", ".", substr($path, 0, $pos));
$file = substr($path, $pos + 1);
//echo "\$JSI.preload('{$path}'.substring(0,{$pos}).replace('/', '.'),'{$path}'.substring({$pos} + 1),function(){eval(this.varText);";
echo "\$JSI.preload('{$pkg}','{$file}',function(){eval(this.varText);";
echo safe_file_get_contents(realpath($path));
echo "\n})";
?>